Type Definitions

The following type definitions are available globally.

  • The callback handler gives an access token or an error. The error occurs if an attempt to refresh the access token is unsuccessful.

    Declaration

    Objective-C

    typedef void (^ZohoAuthAccessTokenHandler)(NSString *, NSError *)

    Swift

    typealias ZohoAuthAccessTokenHandler = (UnsafeMutablePointer

    Parameters

    token

    This token should be sent in the Authorization Header.(Header Value should be @Zoho-oauthtokenTOKEN forHTTPHeaderField:@Authorization where TOKEN is the NSString accessToken obtained in this block)

    error

    Respective error object if the attempt to refresh the access token is unsuccessful.

  • The callblack handler at Sign-in that gives the access token if there is no error. Using this handler, you can redirect to your app’s signed-in state and present your respective screens if the error is nil.

    Declaration

    Objective-C

    typedef void (^ZohoAuthSignInHandler)(NSString *, NSError *)

    Swift

    typealias ZohoAuthSignInHandler = (UnsafeMutablePointer

    Parameters

    token

    OAuth access token of the signed-in user.

    error

    Respective error object.

  • The callback handler for revoking the access token at logout. Nil error means that the access token was revoked successfully. You can handle your apps logout logic in this handler if there is no error.

    Declaration

    Objective-C

    typedef void (^ZohoAuthRevokeAccessTokenHandler)(NSError *)

    Swift

    typealias ZohoAuthRevokeAccessTokenHandler = (UnsafeMutablePointer

    Parameters

    error

    Respective error object of revoke network call.

  • The callback handler for uploading a profile picture. Nil error means that the photo has been successfully uploaded.

    Declaration

    Objective-C

    typedef void (^ZohoAuthUploadHandler)(NSError *)

    Swift

    typealias ZohoAuthUploadHandler = (UnsafeMutablePointer

    Parameters

    error

    Respective error object of failed profile photo upload.